package com.zit.java.service.reimburse;


import com.zit.java.dao.ReimburseMsgMapper;
import com.zit.java.pojo.ReimburseMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReimburseSerivceImpl implements ReimburseSerivce {

    @Autowired
    ReimburseMsgMapper mapper;


    @Override
    public List<ReimburseMsg> queryAllReimburse() {

      List<ReimburseMsg> reimburseMsgList  =   mapper.selectAllReimburse();

        return reimburseMsgList;
    }

    /**
     * 通过日期或者时间查询数据
     * @param name
     * @param
     * @return
     */

    @Override
    public List<ReimburseMsg> queryByNameAndDate(String name,String date) {
        List<ReimburseMsg> rest = mapper.queryByNameAndDate(name,date);
        return rest;
    }

    /**
     * 保存数据
     *
     * @param reimburseMsg
     * @return
     */
    @Override
    public int insertData(ReimburseMsg reimburseMsg) {
        int insert = mapper.insert(reimburseMsg);
        return insert;
    }
}
